package org.springblade.wechat.feign;

import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.tool.api.R;
import org.springblade.wechat.entity.MyWxMpTemplateMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;

/**
 * @author LK
 * @version 1.0.0
 * @Title: IMpClient.java
 * @Description: TODO
 * @date 2020/4/9 13:51
 */
@FeignClient(
	value = AppConstant.APPLICATION_NAME_PREFIX + "wechat",
	fallback = IMpClientFallback.class
)
public interface IMpClient {

	/**
	 * 接口前缀
	 */
	String API_PREFIX = "/wxmp";

	/**
	 * 发送微信公众号模板消息
	 *
	 * @param myWxMpTemplateMessageList
	 * @return
	 */
	@GetMapping(API_PREFIX + "/sendWxMpTemplateMessage")
	R<HashMap<String, Object>> sendWxMpTemplateMessage(@RequestParam(value = "myWxMpTemplateMessageList", required = false) String myWxMpTemplateMessageList,
													   @RequestParam(value = "xxlx") String xxlx);

	/**
	 * 根据微信公众号id和用户id获取openId
	 *
	 * @param mpId
	 * @param userId
	 * @return
	 */
	@GetMapping(API_PREFIX + "/userMpOpenId")
	R<String> getOpenIdByMpIdAndUserId(@RequestParam("mpId") String mpId, @RequestParam("userId") String userId);
}
